/*     */ package com.iris.egrant.component.service;
/*     */ 
/*     */ import com.iris.egrant.component.dao.HelpTipsDao;
/*     */ import com.iris.egrant.component.model.HelpTips;
/*     */ import com.iris.egrant.exception.ServiceException;
/*     */ import java.io.Serializable;
/*     */ import java.util.Date;
import java.util.List;
/*     */ import net.sf.ehcache.Ehcache;
/*     */ import net.sf.ehcache.Element;
/*     */ import org.apache.commons.lang.StringUtils;
/*     */ import org.slf4j.Logger;
/*     */ import org.slf4j.LoggerFactory;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Service;
/*     */ import org.springframework.transaction.annotation.Transactional;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @Service("helpTipsService")
/*     */ @Transactional(rollbackFor = {Exception.class})
/*     */ public class HelpTipsServiceImpl
/*     */   implements HelpTipsService
/*     */ {
/*     */   private static final long serialVersionUID = 7094161342820941223L;
/*  29 */   protected Logger logger = LoggerFactory.getLogger(getClass());
/*     */ 
/*     */   
/*     */   @Autowired
/*     */   private HelpTipsDao helpTipsDao;
/*     */   
/*     */   private Ehcache helpTipsCache;
/*     */ 
/*     */   
/*     */   public Ehcache getHelpTipsCache() {
/*  39 */     return this.helpTipsCache;
/*     */   }
/*     */   
/*     */   public void setHelpTipsCache(Ehcache helpTipsCache) {
/*  43 */     this.helpTipsCache = helpTipsCache;
/*     */   }
/*     */ 
/*     */   
/*     */   public void save(HelpTips helpTips) throws ServiceException {
/*  48 */     if (helpTips == null) {
/*     */       return;
/*     */     }
/*  51 */     this.helpTipsDao.save(helpTips);
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public HelpTips findHelpTipsByKey(String key) throws ServiceException {
                        HelpTips  helpTips = new HelpTips();
                        helpTips.setCreateDate(new Date());
    helpTips.setKey("1");
    helpTips.setEnUsContent("111");
    helpTips.setRemark("112");
    helpTips.setPsnCode(100011225L);
    helpTips.setEnUsTitle("113");
    helpTips.setZhCnContent("114");
    helpTips.setZhCnTitle("115");
    helpTips.setZhTwContent("116");
    helpTips.setZhTwTitle("117");
    helpTips.setZhTwContent("118");
///*  57 */     return this.helpTipsDao.findHelpTipsByKey(key);
/*  57 */     return helpTips;
/*     */   }
/*     */ 
/*     */   
/*     */   public HelpTips findHelpTipsByKey(String key, String cacheable) throws ServiceException {
/*  62 */     HelpTips helpTips = null;
/*  63 */     Element element = null;
/*  64 */     this.helpTipsCache.get(key);
/*  65 */     if (element != null) {
/*  66 */       helpTips = (HelpTips)element.getValue();
/*     */     } else {
/*  68 */       helpTips = this.helpTipsDao.findHelpTipsByKey(key);
/*  69 */       putCache(key, helpTips);
/*     */     } 
/*     */     
/*  72 */     return helpTips;
/*     */   }
/*     */ 
/*     */   
/*     */   public void update(HelpTips helpTips) throws ServiceException {
/*  77 */     if (helpTips == null) {
/*     */       return;
/*     */     }
/*  80 */     this.helpTipsDao.save(helpTips);
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public void deleteHelpTipsByKey(String key) throws ServiceException {
/*  86 */     if (StringUtils.isEmpty(key)) {
/*     */       return;
/*     */     }
/*  89 */     this.helpTipsDao.delete(key);
/*  90 */     this.helpTipsCache.remove(key);
/*     */   }
/*     */   
/*     */   public void putCache(String key, HelpTips helpTips) {
/*  94 */     Element element = new Element(key, (Serializable)helpTips);
/*  95 */     this.helpTipsCache.put(element);
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public List<String> findCacheKey() {
/* 101 */     return null;
/*     */   }
/*     */ 
/*     */   
/*     */   public boolean isExistKey(String key) {
/* 106 */     return this.helpTipsDao.isExistKey(key);
/*     */   }
/*     */ }


/* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\component\service\HelpTipsServiceImpl.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */